<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/myTag.tld" prefix="page"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
<script type="text/javascript" src="login/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="login/scripts/common.js"></script>
<script type="text/javascript" src="login/scripts/WebCalendar.js"></script>
<link rel="stylesheet" type="text/css" href="login/css/style.css" />
<link rel="stylesheet" type="text/css" href="login/css/theme1.css" />
<style type="text/css">
#search_bar td {
	border: none;
}
#box td {
	height: 28px;
}
#search_bar {
	width: 920px;
}
</style>
</head>
<body>
<div id="wrapper" style="margin-top: 10px;">
	<div id="content">
		<div id="box">
			<div>
				<h3>
					当前位置&nbsp;:&nbsp;灾情数据管理&nbsp;>>&nbsp;灾情上报 &nbsp;>>&nbsp;灾情上报列表
				</h3>
			</div>
			<div><span style="color:red;">${message }</span></div>
			<div id="search_bar">
			<form action="disasterAction!disUplodaList.action" method="post">
				<table width="100%" border="0" cellspacing="3" cellpadding="0">
				
					<tr>
						<td>
							灾情类型:
						</td>
						<td>
							<s:select name="disasterUpload.distypename" list="dstypes" listKey="dtName" listValue="dtName" theme="simple" value="disasterUpload.distypename" headerKey="" headerValue="所有灾情类型"></s:select>
						</td>
						<td>
							上报时间从:
						</td>
						<td>
							<input name="startTime" onclick="SelectDate(this,'yyyy-MM-dd hh:00:00')" value="${startTime}" readonly="readonly"/>
						</td>
						<td>
							到:
						</td>
						<td>
							<input name="endTime" onclick="SelectDate(this,'yyyy-MM-dd hh:00:00')" value="${endTime}" readonly="readonly"/>
						</td>
						<td>
							<input type="submit" value="查询" />
							<c:if test="${admin.role==1}">
							<input type="button" value="导出灾情数据" id="btn_output" />
							</c:if>
						</td>
					</tr>
				</table>
			</form>
			</div>
			<form action="disasterAction!disSum.action" method="post">
			<table border="0" cellpadding="3" cellspacing="0"
				style="width: 910px;">
				<thead>
					<tr>
						<th>
							上报人
						</th>
						<th>
							灾情类型
						</th>
						<th>
							开始时间
						</th>
						<th>
							上报类型
						</th>
						<th>
							经济总损失(万元): 
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${disasterUploadList}" var="disaster">
						<tr>
							<td class="a-center" width="100">${disaster.reporter }</td>
							<td class="a-center" width="100">${disaster.distypename}</td>
							<td class="a-center" ><fmt:formatDate value="${disaster.starttime}" pattern="yyyy-MM-dd HH:mm"/></td>
							<td class="a-center" width="">${disaster.infosources}</td>
							<td class="a-center" width="150">${disaster.economyloss}</td>
							<td width="150" align="center">
<%--								<a href="disasterAction!generateWord.action?disasterUpload.num=${disaster.num }">生成word</a>&nbsp;|&nbsp;--%>
								<a href="disasterAction!disUploadPage.action?disasterUpload.num=${disaster.num }&actionName=disUploadUpdate">查看</a>
								<c:if test="${admin.role==1}">&nbsp;|&nbsp;
								<a href="disasterAction!disUploadDelete.action?disasterUpload.num=${disaster.num }">删除</a>
								</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div id="pager" class="pageDiv">
			<c:if test="${admin.role==1}">
				<div style="float: left; margin-right: 250px;">
					<input type="button" value="添加上报" onclick="javascript:window.self.location.href='disasterAction!disUploadPage.action?actionName=disUploadSave'">
				</div>
				</c:if>
				<div style="float: right; margin-right: 150px;">
				<page:pageDiv url="disasterAction!reportAll.action" pageBean="${pageBean}" para="disasterUpload.distypename=${disasterUpload.distypename}&startTime=${startTime}&endTime=${endTime}" ></page:pageDiv>
				</div>
			</div>
			</form>
		</div>
		<br />
	</div>
	<script type="text/javascript">
	$(function() {
		$("#btn_output").click(function(){
			//alert("aa");
			var url="disasterAction!outputExcel.action?time="+new Date().getTime();
			window.location.href=url;
		});
	});
</script>
</div>
</body>
</html>